module.exports = function ($scope, $state, create, talist, toaster) {

	$scope.obj = {};
	$scope.obj.loan_limit_price = 0;
	$scope.obj.picket_line = 0;

	talist().then(function (res) {
		if (res.errcode === 0) {
			$scope.taarr = res.data;
			$scope.obj.seller_code = $scope.taarr[0].CODE;
		}
		else {
			toaster.error({title: '', body: res.errmsg})
		}
	});

	$scope.gogo = function () {
		create.save($scope.obj, function (res) {
			if (res.errcode === 0) {
                toaster.success({title: '', body: '创建成功'})
				$state.go('app.depositList');
			}
			else {
                toaster.error({title: '', body: res.errmsg})
			}
		});
	};

};